package testAction

import com.sxdz.constant.GlobalConstant
import org.junit.Test
import testAction.base.BaseControllerTest

/**
 * Created by andy on 2016/8/8.
 */
class testOrderAction  extends  BaseControllerTest{

    @Test
        void getAllOrderByStatus() {
        comm_get("/order/queryOrderStatus/1");
    }


    @Test
    void getOrders() {
        //comm_get("/order/getOrders?dateType=3&openId=oj-GvuAhfHnIG_1RjvVBXomtUumg&pageNum=1&payStatus=00");
        //comm_get("/order/getOrders?openId=oj-GvuAhfHnIG_1RjvVBXomtUumg&pageNum=3&payStatus=00");//查询订单
        comm_get("/order/getRecharges?openId=oj-GvuEqxFYpz9JvAWt21ZiOIftA&pageNum=1");//查询缴费记录
        //comm_get("/order/getOrderDetail/20");//查询orderDetail
        //comm_get("/order/queryOrderOrderStatus?openid=oj-GvuAhfHnIG_1RjvVBXomtUumg&payStatus=00&pageNum=1");//按订单状态查询
    }

    @Test
    void payOrder() {
        comm_get("/orderPay/getOuttradeno?openid=oj-GvuAhfHnIG_1RjvVBXomtUumg")
        Map<String,String> paramsMap=[:];
        //实体商品
       /* paramsMap << [openid:"oj-GvuAhfHnIG_1RjvVBXomtUumg"]
        paramsMap << [goodsName:"机顶盒2"]
        paramsMap << [totalFee:"20000"]
        paramsMap << [reserve1:"jdg0000001"]
        paramsMap << [orderDetJson:"[{itemName:\"机顶盒1\",itemSum:\"20000\",itemNum:\"1\",itemDesc:\"机顶盒而已\"},{itemName:\"机顶盒2\",itemSum:\"20002\",itemNum:\"1\",itemDesc:\"机顶盒而已22\"}]"]
        paramsMap << [consigneeName:"木子李"]
        paramsMap << [consigneePhone:"13512341234"]
        paramsMap << [consigneeAddress:"上海市啥啥啥啥"]
        paramsMap << [invoiceType:"个人"]*/

        //虚拟商品
         paramsMap << [openid:"oj-GvuAhfHnIG_1RjvVBXomtUumg"]
         paramsMap << [goodsName:"点歌卡2"]
         paramsMap << [totalFee:"30000"]
         paramsMap << [orderDetJson:"[{itemName:\"点歌卡\",itemSum:\"30000\",itemNum:\"1\",itemDesc:\"点歌\"}]"]

        comm_post("/orderPay/pay",paramsMap)
    }
    @Test
    void payOrdersss() {
        comm_get("/orderp/getOuttradeno?openid=oj-GvuAhfHnIG_1RjvVBXomtUumg")
        Map<String,String> paramsMap=[:];
        //实体商品
        /* paramsMap << [openid:"oj-GvuAhfHnIG_1RjvVBXomtUumg"]
         paramsMap << [goodsName:"机顶盒2"]
         paramsMap << [totalFee:"20000"]
         paramsMap << [reserve1:"jdg0000001"]
         paramsMap << [orderDetJson:"[{itemName:\"机顶盒1\",itemSum:\"20000\",itemNum:\"1\",itemDesc:\"机顶盒而已\"},{itemName:\"机顶盒2\",itemSum:\"20002\",itemNum:\"1\",itemDesc:\"机顶盒而已22\"}]"]
         paramsMap << [consigneeName:"木子李"]
         paramsMap << [consigneePhone:"13512341234"]
         paramsMap << [consigneeAddress:"上海市啥啥啥啥"]
         paramsMap << [invoiceType:"个人"]*/

        //虚拟商品
        paramsMap << [openid:"oj-GvuAhfHnIG_1RjvVBXomtUumg"]
               paramsMap << [goodsName:"点歌卡3"]
        paramsMap << [totalFee:"30000"]
        paramsMap << [orderDetJson:"[{itemName:\"点歌卡\",itemSum:\"30000\",itemNum:\"1\",itemDesc:\"点歌\"}]"]

        comm_post("/orderp/pay",paramsMap)
    }

    @Test
    void payOrdersss2() {
        comm_get("/orderPay/getOuttradeno?openid=oj-GvuAhfHnIG_1RjvVBXomtUumg")
        Map<String,String> paramsMap=[:];
        //实体商品
         paramsMap << [openid:"oj-GvuAhfHnIG_1RjvVBXomtUumg"]
         paramsMap << [goodsName:"100元2年+ETW-388家用地面数字接收机顶盒"]
         paramsMap << [orderDetJson:[7,53]]
         paramsMap << [consigneeName:"木子李"]
         paramsMap << [consigneePhone:"13512341234"]
         paramsMap << [consigneeAddress:"上海市啥啥啥啥"]
         paramsMap << [invoiceType:"个人"]

        //虚拟商品
        /*paramsMap << [openid:"oj-GvuAhfHnIG_1RjvVBXomtUumg"]
        paramsMap << [goodsName:"点歌卡3"]
        paramsMap << [totalFee:"30000"]
        paramsMap << [orderDetJson:"[{itemName:\"点歌卡\",itemSum:\"30000\",itemNum:\"1\",itemDesc:\"点歌\"}]"]*/

        comm_post("/orderPay/pay2",paramsMap)
    }

    @Test
    void recharge2() {
        comm_get("/orderPay/getOuttradeno?openid=oj-GvuAhfHnIG_1RjvVBXomtUumg")
        Map<String,String> paramsMap=[:];
        //维护费
        paramsMap << [openid:"oj-GvuAhfHnIG_1RjvVBXomtUumg"]
        paramsMap << [id:"67"]
       paramsMap << [intelligentNo:"8035199001019691"]
        //paramsMap << [intelligentNo:"8002199054511281"]


        comm_post("/orderPay/recharge2",paramsMap)
    }

    @Test
    void kPay() {
        Map<String,String> paramsMap=[:];
        //维护费
        paramsMap << [openid:"oj-GvuAhfHnIG_1RjvVBXomtUumg"]
        paramsMap << [orderId:"148"]



        comm_post("/orderPay/kPay",paramsMap)
    }
    @Test
    void delteOrder() {
        comm_get("/order/delOrders/114")
    }

    @Test
    void getBossAcc() {
        //comm_get("/account/getBossAcc?intelligentNo=123456")
        //comm_get("/account/getBossAcc?intelligentNo=8035199001019691")
        comm_get("/account/getBossAcc?intelligentNo=0000000000003233")
    }

    @Test
    void getOrderId(){
        comm_get("/order/getOrder/308")
    }
}
